<!DOCTYPE html>
<html
        xmlns:th="http://www.thymeleaf.org"
        xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
        xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!-- page content -->
<div class="container blog-content-container">
    <div sec:authorize="isAuthenticated()">
        <p>已有用户登录</p>
        <p>用户名:<span sec:authentication="name"></span></p>
        <p>角色为:<span sec:authentication="principal.authorities"></span></p>
    </div>
    <div sec:authorize="isAnonymous()">
        <p>未有用户登录</p>
    </div>
</div>
</body>
</html>